{block name="circle_layout"}
	{include file="common:common_layout"}
{/block}
{extend name="common/layout" /}
{block name="style"}{/block}
{block name="content"}
<div class="base-layout">
    <div class="mainbox">
        {include file="circle:manage:top" /}

        <table class="base-table-style">
            <thead>
            <tr>
                <th class="w30"></th>
                <th class="tl">成员</th>
                <th class="w70">等级</th>
                <th class="w70">申请时间</th>
                <th class="w380">申请理由</th>
                <th class="w120">操作</th>
            </tr>
            <tr>
                <?php if(!empty($mapply_list)){?>
                <td class="tc"><input id="all" class="checkall" type="checkbox" /></td>
                <td colspan="5" class="batches"><label for="all" class="handle-btn"><i class="ac0"></i>全选</label>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="{:url('circle/managemapply/mapply_pass')}?c_id=<?php echo $c_id;?>" name="cm_id" confirm="最多只能添加<?php echo sysconf('circle_managesum');?>个管理员，超出部分不会被添加。" title="设为管理"><i class="ac1"></i>通过</a>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="{:url('circle/managemapply/del')}?c_id=<?php echo $c_id;?>" name="cm_id" confirm="您确定要删除吗?" title="删除"><i class="ac5"></i>删除</a>
                    <?php }?>
            </tr>
            </thead>
            <tbody>
            <?php if(!empty($mapply_list)){?>
            <?php foreach (($mapply_list) as $val){?>
            <tr>
                <td><input class="checkitem" type="checkbox" value="<?php echo $val['member_id'];?>"></td>
                <td><dl class="member-base"><dt class="member-name"><a href="javascript:void(0)" target="_blank"><?php echo $val['member_name'];?></a><?php echo memberIdentity($val['is_identity']);?></dt><dd class="member-avatar-s"><img src="<?php echo $val['member_avatar'];?>" /><?php if($val['is_star']){echo '<dd class="member-star" title="'.明星成员.'"></dd>';}?></dd>
                </dl></td>
                <td><?php echo $val['cm_level'];?></td>
                <td><?php echo @date('Y-m-d', $val['mapply_time']);?></td>
                <td class="time"><?php echo $val['mapply_reason'];?></td>
                <td class="handle">
                    <a href="javascript:void(0);" onclick="mapplyPass(<?php echo $val['member_id'];?>);">通过</a>
                    |&nbsp;<a href="javascript:void(0)" onclick="mapplyDel(<?php echo $val['member_id'];?>);">删除</a>
            </tr>
            <?php }?>
            <?php }else{?>
            <tr>
                <td colspan="20" class="noborder"><p class="no-record">没有符合条件的记录</p></td>
            </tr>
            <?php }?>
            </tbody>
            <?php if(!empty($mapply_list)){?>
            <tfoot>
            <tr>
                <th class="tc"><input id="all" class="checkall" type="checkbox" /></th>
                <th colspan="20" class="batches"><label for="all" class="handle-btn"><i class="ac0"></i>全选</label>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="<?php echo url('circle/managemapply/mapply_pass');?>?c_id=<?php echo $c_id;?>" name="cm_id" confirm="最多只能添加<?php echo sysconf('circle_managesum');?>个管理员，超出部分不会被添加。" title="设为管理"><i class="ac1"></i>通过</a>
                    <a href="javascript:void(0);" class="handle-btn" nctype="batchbutton" uri="<?php echo url('circle/managemapply/del');?>?c_id=<?php echo $c_id;?>" name="cm_id" confirm="确认删除？" title="删除"><i class="ac5"></i>删除</a>
            </tr>
            <tr><td colspan="20"><div class="pagination"><?php echo $show_page;?></div></td></tr>
            </tfoot>
            <?php }?>
        </table>
    </div>
    <div class="sidebar">
        {include file="circle:manage:sidebar" /}

    </div>
</div>
<script src="__CIRCLE_RESOURCE__/js/circle_manage.js"></script>
<script>
    function mapplyPass(id){
        showDialog('最多只能添加<?php echo sysconf('circle_managesum');?>个管理员，超出部分不会被添加。', 'confirm', '', function(){
            _uri = "<?php echo url('circle/managemapply/mapply_pass');?>?c_id=<?php echo $c_id;?>&cm_id="+id;
            ajaxget(_uri);
        });
    }

    function mapplyDel(id){
        showDialog('您确定要删除吗?', 'confirm', '', function(){
            _uri = "<?php echo url('circle/managemapply/del');?>?c_id=<?php echo $c_id;?>&cm_id="+id;
            ajaxget(_uri);
        });
    }
</script>
{/block}